package com.loan.mappers;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.loan.entity.Menu;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * YJS
 */
public interface MenuMapper extends BaseMapper<Menu> {

    /**
     * 根据菜单的id查询菜单表
     * @param menuid
     * @return
     */
    @Select("select * from menu where id=#{id}")
    Menu getByMenuId(int menuid);

    /**
     * 查询所有菜单信息
     * @return
     */
    @Select("select * from menu")
    List<Menu> getAll();


    @Select("SELECT * FROM menu where sub_menu=0")
    List<Menu> getall();

    /**
     * 根据父菜单id查询菜单
     * @param submenu
     * @return
     */
    @Select("select * from menu where sub_menu=#{submenu}")
    List<Menu> getAllSubMenu(int submenu);
}
